﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>函数作为方法调用</title>
</head>
<body>
    <p>myObject.fullName()返回全名:</p>
    <p id="demo"></p>
    <script>
        let myObject = {
            firstName: "刘",
            lastName: "天佑",
            fullName: function () {
                return this.firstName + " " + this.lastName;
            }
        }
        document.getElementById("demo").innerHTML = myObject.fullName();
    </script>
</body>
</html>
